package com.example.file.exception;


import com.example.file.response.ResultEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ServiceException extends RuntimeException {


    private String code;

    private String message;


    public ServiceException(String code, String message) {
        super(message, null, false, false);
        this.code = code;
        this.message = message;
    }

    public ServiceException(String message) {
        super(message, null, false, false);
        this.code = ResultEnum.EXCEPTION.getCode();
        this.message = message;
    }

    public ServiceException(ResultEnum resultEnum) {
        super(resultEnum.getMsg(), null, false, false);

        this.code = resultEnum.getCode();
        this.message = resultEnum.getMsg();
    }


}
